<?php

declare (strict_types=1);

namespace App\Model;

use Hyperf\Database\Model\Collection;
use Hyperf\DbConnection\Model\Model;

/**
 * @property Collection adminMenus
 */
class AdminRole extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'admin_role';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['name','remark'];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = [];


    public function adminMenus()
    {

        return $this->belongsToMany(AdminMenu::class, 'admin_role_menu', 'role_id', 'menu_id');

    }
}